package com.pan.entity;

import com.pan.enume.ResultEnum;
import com.pan.vo.Cart;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;


@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Result<T> {

    Integer code;
    String message;
    T data;

    public Result(Integer code,String message){
        this.code = code;
        this.message = message;
    }

    public Result(ResultEnum resultEnum){
        this.code = resultEnum.getCode();
        this.message = resultEnum.getMessage();
    }


    public Result(ResultEnum resultEnum, T li_data) {
        this.code = resultEnum.getCode();
        this.message = resultEnum.getMessage();
        this.data = li_data;
    }
}
